
<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->


<title>基本设置</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 基本设置 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<form class="form form-horizontal" id="accountInfoForm">
		<div id="tab-system" class="HuiTab">
			<div class="tabBar cl"><span>基本设置</span><span>安全设置</span></div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="userName" placeholder="控制在25个字、50个字节以内" readonly value="${(account.userName)!''}" class="input-text">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>工号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="personId" placeholder="5个左右,8汉字以内,用英文,隔开" value="${(account.personId)!''}" class="input-text">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>姓名：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="realName" placeholder="空制在80个汉字，160个字符以内" value="${(account.realName)!''}" class="input-text">
					</div>
				</div>
			</div>
			<div class="tabCon">
	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">原密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" value="${(account.userpwd)!''}" id="userpwd" name="userpwd" />
					</div>
				</div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-2">确认原密码：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="password" class="input-text" value="" id="checkUserpwd" name="checkUserpwd" />
                    </div>
                </div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">新密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" value="" id="newUserpwd" name="newUserpwd" >
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">确认密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" value="" id="checkpwd" name="checkpwd" >
					</div>
				</div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onClick="$("#accountInfoForm").submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>

<!--_footer 作为公共模版分离出去--> 
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去--> 

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$.Huitab("#tab-system .tabBar span","#tab-system .tabCon","current","click","0");
});

$("#accountInfoForm").validate({
		rules:{
			userName:{
				required:true,
				minlength:4,
				maxlength:16
			},
			checkUserpwd:{
			
				equalTo: "#userpwd"
			},
			newUserpwd:{
				
			},
			checkpwd:{
			
				equalTo: "#newUserpwd"
			},
			
			realName:{
				required:true,
			}
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			
	   		$.ajax({
	            type: 'put', 
				contentType:"application/json", 
	            url: '/editAccount/${account.uid}', 
	            data:JSON.stringify({
						'userName': $("#userName").val(),
						'realName': $("#realName").val(),
						'personId': $("#personId").val(),
		                'userpwd': $("#newUserpwd").val()
						}),
	            success:function(data){ 
	 				console.log('提交成功！');
	 				var index = parent.layer.getFrameIndex(window.name);
					parent.location.reload();
					parent.layer.close(index);
	            }
	
	        });

			
		}
	});


function layer_close(){
	window.location.close();
}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>